package com.ts.feign.api;

import com.ts.common.entity.ResponseResult;
import com.ts.movie.dto.MovieDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(value = "ts-movie", path = "/movie") // 把接口和服务做了绑定
public interface MovieMgtService {
    @GetMapping("/action/query")
    ResponseResult query();

    @GetMapping("/{id}")
    ResponseResult query(@PathVariable Integer id);

    @PostMapping
    ResponseResult add(@RequestBody MovieDTO movie);

    @PostMapping("/action/update")
    ResponseResult update(@RequestBody MovieDTO movie);

    @PostMapping("/action/delete/{id}")
    ResponseResult delete(@RequestBody List<Integer> ids);

}
